<%@page import="org.quickbundle.project.common.vo.RmCommonVo"%>
<%@page import="java.util.List"%>
<%@page import="org.quickbundle.project.RmProjectHelper"%>
<%@page import="org.quickbundle.orgauth.rmauthorizeresource.vo.RmAuthorizeResourceVo"%>
<%@page import="com.dfhc.util.CryptoHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<html>
<head>
<%-- <%@ include file="/jsp/include/rmGlobal.jsp" %>
<%@ include file="/jsp/include/rmGlobal_insert.jsp" %> --%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ taglib uri="/dfhc" prefix="dfhc" %>
<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<title></title>
<script type="text/javascript">
$(function(){
	var list='${empty bean}';
	if(list=='false'){
		$('#name').value='${bean.name}';
		$('#bs_keyword').value='${bean.bs_keyword}';
		$('#old_resource_id').value='${bean.old_resource_id}';
		$('#resource_id').value='${bean.resource_id}';
	}
	if(list=='false' && '1'=='${bean.default_access}'){
		$('#default_access_a').attr("checked","checked");
	}
	if(list=='false' && '0'=='${bean.default_access}'){
		$('#default_access_b').attr("checked","checked");
	}
});
  	function update_onClick(id){  //保存修改后的单条数据
  		var bs_keyword ='${bs_keyword}';
  		var old_resource_id ='${old_resource_id}';
  		layer.confirm('确认要保存吗？',function(index){
  			var url='<%=request.getContextPath()%><%=CryptoHelper.encryptUrl(request,"/rmFunctionNode/updateDefaultAccess")%>?bs_keyword='+bs_keyword+'&old_resource_id='+old_resource_id;
  			var ssurl='<%=request.getContextPath()%><%=CryptoHelper.encryptUrl(request,"/rmFunctionNode/functionNode")%>';
  			submitAjax(url,$("#form").serialize(),ssurl);
			/* window.parent.location.reload();
			layer.closeAll(); */
  		});
	 /*    form.action=;
    	form.submit();  */
	}
</script>
</head>
<body >
<form name="form" method="post" id = "form">
<dfhc:table templateId="table_h_ui">
	<dfhc:tr align="center">
		<dfhc:td >
		公开<dfhc:input id="default_access_a" name="default_access" type="radio" value="1" onclick="refreshAuthorizeFrame()"  validate="notNull;" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		受控<dfhc:input id="default_access_b" name="default_access" type="radio" value="0" onclick="refreshAuthorizeFrame()"  validate="notNull;" />
	<dfhc:button templateId="h_ui_update_button" onclick="update_onClick()" />
	
	
		</dfhc:td>
	
	</dfhc:tr>
	
	
<%-- 	<dfhc:tr>
		<dfhc:td align="center" colspan="4"></dfhc:td>
	</dfhc:tr>
	<dfhc:tr>
		<dfhc:td align="right" width="20%">&nbsp;</dfhc:td>
		<dfhc:td width="35%">&nbsp;</dfhc:td>
		<dfhc:td align="right" width="20%">&nbsp;</dfhc:td>
		<dfhc:td width="25%">&nbsp;</dfhc:td>
	</dfhc:tr>	 --%>
</dfhc:table>
<input type="hidden"" name="name" id="name" value="" />
<input type="hidden"" name="bs_keyword" id="bs_keyword" value="" />
<input type="hidden" name="old_resource_id" id="old_resource_id" value="" />
<input type="hidden" name="resource_id" id="resource_id" value="" /> 
</form>	
<br>		
</body>
</html>
<script type="text/javascript">
/*   	function refreshAuthorizeFrame(){  //保存修改后的单条数据
		for(var i=0; i<form.default_access.length; i++) {
			if(form.default_access[i].value == "0" && form.default_access[i].checked) {
				parent.document.getElementById("authorize_frame_tr").style.display = "block";
			} else {
				parent.document.getElementById("authorize_frame_tr").style.display = "none";
			}
		}
	} */
	
</script> 